package model

import (
	"redTeaHouse/utils"
)

func FindExistPhone(phone string, dbName string) bool {
	var id int
	DB := utils.OpenDatabase()
	defer DB.Close()
	rowObj := DB.QueryRow("select id from "+dbName+" where phone=?", phone)
	rowObj.Scan(&id)

	if id != 0 {
		return true
	} else {
		return false
	}
}
